package org.tity.sql.code.entity.test;

import org.tity.sql.entity.EntitySet;
import org.tity.sql.data.RcdSet;
import org.tity.sql.data.Rcd;
import java.util.Map;
import java.util.List;



/*
 * 此类代码为自动生成，请勿修改 !
 */

/**
 * 联合主键表
 * @author tity-code-builder-powered-by-lifangjie
 * @date 2020-06-05 10:40:33
 **/
public class RelationTitySet extends EntitySet<RelationTity> {

	public RelationTitySet(RcdSet rs) {
		super(rs);
	}

	/**
	 * 构造函数,构建空集合
	*/
	public RelationTitySet() {
		super(null);
	}

	@Override 
	public RelationTity createEntity(Rcd r) {
		return new RelationTity(this,r);
	}

	/**
	 * 快速构建函数,从Map构建,null值或非RelationTity类型的对象忽略
	*/
	public static RelationTitySet fromMap(Map map) {
		RelationTitySet set=new RelationTitySet();
		Object obj=null;
		for (Object key : map.keySet()) {
			obj=map.get(key);
			if(obj==null || !(obj instanceof RelationTity)) {continue;}
			set.addEntity((RelationTity)obj);
		}
		return set;
	}

	/**
	 * 快速构建函数,从List构建,null值或非RelationTity类型的对象忽略
	*/
	public static RelationTitySet fromList(List list) {
		RelationTitySet set=new RelationTitySet();
		for (Object obj : list) {
			if(obj==null || !(obj instanceof RelationTity)) {continue;}
			set.addEntity((RelationTity)obj);
		}
		return set;
	}

}
